package interact.click;

import java.util.Random;

import processing.core.PApplet;
import processing.core.PVector;
import co.edu.unal.cg.splines.interact.InteractiveNaturalSpline;
import co.edu.unal.cg.splines.interact.InteractiveNaturalSpline.NaturalSplineControlPoint;
import remixlab.proscene.Camera;
import remixlab.proscene.Point;

public class AddNaturalSplineControlPoint implements ClickAction{

	InteractiveNaturalSpline interactiveSpline;
	PApplet canvas;
	
	public AddNaturalSplineControlPoint(InteractiveNaturalSpline interactive,PApplet canvas){
		interactiveSpline = interactive;
		this.canvas = canvas;
	}
	
	@Override
	public void click(Integer button, int numberOfClicks, Camera camera) {
		
		PVector orig = new PVector();
		PVector dir = new PVector();
		Random rand = new Random();
//		camera.convertClickToLine(new Point(rand.nextInt(camera.screenHeight()), rand.nextInt(camera.screenWidth())),orig,dir);
//		PVector point = PVector.add(orig, PVector.mult(dir, 1));
//		System.out.println("Creating natural spline control point at : " + point.toString());
		interactiveSpline.addControlPoint(new PVector(rand.nextInt(100),rand.nextInt(100)));
	}
	

}
